#include "shift_library.h"
#include <wiringShift.h>

//shift-libary
PHP_FUNCTION(shiftIn)
{
    zend_long dPin;
    zend_long cPin;
    zend_long order;

	ZEND_PARSE_PARAMETERS_START(3, 3)
		Z_PARAM_LONG(dPin)
        Z_PARAM_LONG(cPin)
        Z_PARAM_LONG(order)
	ZEND_PARSE_PARAMETERS_END();

    long ret = shiftIn(dPin, cPin, order);
    RETURN_LONG(ret);
}

PHP_FUNCTION(shiftOut)
{
    zend_long dPin;
    zend_long cPin;
    zend_long order;
    zend_long val;

	ZEND_PARSE_PARAMETERS_START(2, 2)
		Z_PARAM_LONG(dPin)
        Z_PARAM_LONG(cPin)
        Z_PARAM_LONG(order)
        Z_PARAM_LONG(val)
	ZEND_PARSE_PARAMETERS_END();

    shiftOut(dPin, cPin, order, val);
}
//end for shift-libary